#include "system.h"
#include "p18cxxx.h"


/* Refer to the device datasheet for information about available
oscillator configurations. */
void ConfigureOscillator(void)
{
    /*On device Resets, the output frequency of the internal oscillator is set 
     * to the default frequency of 1 MHz.*/

    /* The Internal Oscillator Frequency Select bits(IRCF<2:0>)select the
     * frequency output of the internal oscillator block. The choices are:
     *  ICFR | Internal Oscillator Frequency
     *  --------------
     *  111 = 16 MHz
     *  110 = 8 MHz
     *  101 = 4 MHz
     *  100 = 2 MHz
     *  011 = 1 MHz(3)Default
     *  010 = 500 kHz
     *  001 = 250 kHz
     *  000 = 31 kHz
     */

    OSCCONbits.IRCF=0b101;

}
